package main

import "fmt"

// Author : CSR丶WARRIOR
// Time ： 2020/10/16  13:01
// TOOLS : GoLand
// FILENAME : Member operation.go
// STATEMENT: 成员操作
//定义父类
type person2 struct {
	id   uint
	name string
	age  uint
}

//子类
type teacher1 struct {
	person2
	salary float64
}

type student1 struct {
	person2
	score int
}

func main() {
	stu := student1{
		person2: person2{1, "zs", 19},
		score:   213,
	}
	t := teacher1{
		person2: person2{1, "xf", 32},
		salary:  9999,
	}
	//获取学生成绩
	fmt.Println(stu.score) //213
	//获取学生年龄
	fmt.Println(stu.person2.age) //19

	//获取teacher的salary
	fmt.Println(t.salary) //9999
}
